package mygraph;

import java.util.ArrayList;
import java.util.List;

public class Table {
	private List<List<Character>> list;
	private List<Character> headNodes;
	private int n;
	private int nVerts;
	
	public Table() {
		super();
		this.list = new ArrayList<List<Character>>();
		this.headNodes = new ArrayList<Character>();
		list.add(new ArrayList<Character>());
		list.add(new ArrayList<Character>());
		list.add(new ArrayList<Character>());
		list.add(new ArrayList<Character>());
	}
	public void addVertx(char x) {
		headNodes.add(x);
	}
	public void addEdge(int start, int end) {
		list.get(start).add(headNodes.get(end));
		list.get(end).add(headNodes.get(start));
	}
	
	
	public  void printVertice() {
		for(List ls :list) {
			for(Object i : ls) {
				System.out.print(i + "\t");
			}
			System.out.println();
		}
	}
	public static void main(String[] args) {
		Table t = new Table();
		t.addVertx('a');		//0
		t.addVertx('b');		//1
		t.addVertx('c');		//2
		t.addVertx('d');		//3
		t.addEdge(0, 2);		
		t.addEdge(0, 1);
		t.printVertice();	//0- b c	//1- a	//2- a
	}
}
